package com.share.service.sysmgr.privilege;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import com.share.bean.sysmgr.privilege.PrivilegeResourceItem;
import com.share.dao.sysmgr.privilege.PrivilegeResourceItemDao;


@Component("privilegeResourceItemManager")
public class PrivilegeResourceItemManagerImpl implements PrivilegeResourceItemManager{
	
	private PrivilegeResourceItemDao resItemDao ;

	@Resource
	public void setresItemDao(PrivilegeResourceItemDao resItemDao) {
		this.resItemDao = resItemDao;
	}

	@Override
	public void deleteResourceItemManager(int id) throws Exception {
		
		this.resItemDao.deleteResourceItemDao(id) ;
	}

	@Override
	public PrivilegeResourceItem queryByIdResourceItemManager(int id) throws Exception {
		
		return this.resItemDao.queryByIdResourceItemDao(id) ;
	}

	@Override
	public List<PrivilegeResourceItem> queryResourceItemManager() throws Exception {
		
		String hql = "select o from PrivilegeResourceItem o" ;
		
		return this.resItemDao.queryResourceItemDao(hql) ;
	}

	@Override
	public Serializable saveResourceItemManager(PrivilegeResourceItem res) throws Exception {
		res.setAddDate(new Date()) ;
		return this.resItemDao.saveResourceItemDao(res) ;
	}

	@Override
	public void updateResourceItemManager(PrivilegeResourceItem res) throws Exception {
		res.setAddDate(new Date()) ;
		this.resItemDao.updateResourceItemDao(res) ;
	}

}
